<template>
  <div class="home">
    <StarryBackground />
    <MeadowBackground />
    <section class="hero">
      <div class="container hero-content">
        <div class="avatar-container float">
          <img :src="profile.avatar" :alt="profile.name" class="avatar">
        </div>
        <h1 class="title">
          <span class="greeting">{{ $t('home.greeting') }}</span>
          <span class="name">{{ profile.name }}</span>
        </h1>
        <p class="role">{{ $t('home.role') }}</p>
        <p class="description">{{ $t('home.description') }}</p>
        <div class="cta-buttons">
          <router-link to="/projects" class="btn">
            {{ $t('nav.projects') }}
          </router-link>
          <router-link to="/contact" class="btn btn-outline">
            {{ $t('nav.contact') }}
          </router-link>
        </div>
        <div class="social-links">
          <a v-for="link in socialLinks" 
             :key="link.name"
             :href="link.url"
             target="_blank"
             rel="noopener noreferrer"
             class="social-link"
          >
            <i :class="link.icon"></i>
          </a>
        </div>
      </div>
    </section>
  </div>
</template>

<script>
import StarryBackground from '@/components/StarryBackground.vue'
import MeadowBackground from '@/components/MeadowBackground.vue'

export default {
  name: 'Home',
  
  components: {
    StarryBackground,
    MeadowBackground
  },
  
  data() {
    return {
      profile: {
        name: '三岁',
        avatar: 'http://q1.qlogo.cn/g?b=qq&nk=1578393930&s=640',
      },
      socialLinks: [
        {
          name: 'GitHub',
          url: 'https://github.com/yourusername',
          icon: 'fab fa-github'
        },
        {
          name: 'LinkedIn',
          url: 'https://linkedin.com/in/yourusername',
          icon: 'fab fa-linkedin'
        },
        {
          name: 'Twitter',
          url: 'https://twitter.com/yourusername',
          icon: 'fab fa-twitter'
        }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.home {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
}

.hero {
  width: 100%;
  padding-top: var(--header-height);
  text-align: center;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

.avatar-container {
  width: 150px;
  height: 150px;
  margin: 0 auto 2rem;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--accent-color);
  box-shadow: var(--card-shadow);
  
  img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

.title {
  font-size: 3rem;
  margin-bottom: 1rem;
  
  .greeting {
    display: block;
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
  }
  
  .name {
    color: var(--accent-color);
  }
}

.role {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.description {
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
  
  .btn-outline {
    background-color: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    
    &:hover {
      background-color: var(--accent-color);
      color: white;
    }
  }
}

.social-links {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  
  .social-link {
    color: var(--text-secondary);
    font-size: 1.5rem;
    transition: all var(--transition-speed);
    
    &:hover {
      color: var(--accent-color);
      transform: translateY(-3px);
    }
  }
}

@media (max-width: 768px) {
  .title {
    font-size: 2.5rem;
  }
  
  .role {
    font-size: 1.25rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    padding: 0 2rem;
  }
}
</style> 